package  
{
	import flash.utils.ByteArray;
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Tilemap;
	import net.flashpunk.masks.Grid;
	/**
	 * © 2012 TheJavaArcade.com
	 */	
	public class Nocollide extends Entity 
	{
		private var tiles:Tilemap;
		private var grid:Grid;
		
		public function Nocollide(theLevel:int){
			tiles = new Tilemap(Assets.JUNGLE_TILES, 1200, 720, 8, 8);
			
			grid = new Grid(1200, 720, 8, 8);
			layer = 5;
			graphic = tiles;
			loadTiles(theLevel);
			
		}
		
		private function loadTiles(theLevel:int):void {
			var dataList:XMLList;
			var dataElement:XML;
			
			dataList = GameEngine.levelXML[theLevel].c.tile;
			for each(dataElement in dataList) {
				tiles.setTile(dataElement.@x, dataElement.@y, dataElement.@id);
				grid.setTile(dataElement.@x, dataElement.@y, true);
			}
		}
		
	}

}